home *** CD-ROM | disk | FTP | other *** search
/ Internet Tools (InfoMagic) / Internet Tools.iso / dos_win / winsock / hacklist / 94-04.Z / 94-04 / 000018_jobrien@mcs.umes.umd.edu_Mon Apr 25 07:59:56 1994.msg < prev   
Internet Message Format  |  1994-04-30  |  11KB

  1. Received: from umd5.umd.edu by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
  2.           id AA10130; Mon, 25 Apr 1994 11:59:36 -0400
  3. Received: from mcs.umes.umd.edu (umescsnw1.umd.edu [131.118.127.2]) by umd5.umd.edu(8.6.4/94Jan25)
  4.     with SMTP id LAA27082; Mon, 25 Apr 1994 11:59:20 -0400
  5. Received: from UMESCSNW1/MAILQUEUE by mcs.umes.umd.edu (Mercury 1.11);
  6.     Mon, 25 Apr 94 12:00:41 EDT
  7. Received: from MAILQUEUE by UMESCSNW1 (Mercury 1.11); Mon, 25 Apr 94 12:00:01 EDT
  8. To: winsock-hackers@sunsite.unc.edu
  9. From: "James M. O'Brien, Jr" <jobrien@mcs.umes.umd.edu>
  10. Organization: University of MD Eastern Shore
  11. Date:         Mon, 25 Apr 1994 11:59:56 EDT
  12. Subject:      FD_READ @ recv() 
  13. Reply-To: jobrien@diver.umd.edu
  14. Priority: normal
  15. X-Mailer:     WinPMail v1.0 (R2)
  16. Message-Id: <26C62214D48@mcs.umes.umd.edu>
  17.  
  18. I've been working with WSAAsyncSelect and FD_READ.  Attempting 
  19. to make wsfinger an async client.  I've been able to do this but I've 
  20. found one glitch I am not sure that either I am handling correclt or its 
  21. not completely obvious to me.
  22.  
  23. As an example: 
  24.  
  25. Once I've connected, I use WSAAsyncSelect to set the socket to NB 
  26. and I want FD_READ....
  27.  
  28. In the wndproc I handle FD_READ and call recv() once for each 
  29. FD_READ received.  Where it appears to become grey, how does one
  30. handle the end of a data stream?  As in receiving a reply from a finger 
  31. server, its not readily apparent, how one would recognize that the 
  32. stream is EOF.   
  33.  
  34. What I've done so far is to test on bytes read using the following:
  35.  
  36. case WM_WINSOCK :
  37.    switch (WSAGETSELECTEVENT(lParam)) {
  38.       case FD_READ :
  39.         // Read Socket Data and Write it out
  40.         if (ReadSocket(hMainEdit) == 0) {
  41.             closesocket(sSocket);
  42.             bCmdInProgress = FALSE;
  43.             SendMessage(hWndMain,WM_SETCURSOR,hWndMain,0L);
  44.            return 0;
  45.   }
  46. ....
  47.  
  48. Now this appears to work fine using Novell's TCP/IP & their 
  49. winsock.dll.  But it doesn't work correctly over Trumpet's winsock.  
  50.  
  51. I'll have to re-read the finger rfc, but I don't recall any explicit end of 
  52. stream markers..  How would one handle this situation?
  53.  
  54. Thanks
  55.  
  56. - Jim O.
  57. From paul@atlas.dev.abccomp.oz.au Wed Apr 27 09:25:31 1994
  58. Received: from usage.csd.unsw.OZ.AU by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
  59.           id AA19750; Wed, 27 Apr 1994 00:12:10 -0400
  60. Received: by usage.csd.unsw.OZ.AU id AA11938
  61.   (5.65c/IDA-1.4.4 for winsock-hackers%sunsite.unc.edu); Wed, 27 Apr 1994 14:11:59 +1000
  62. Received: by atlas (4.1/1.35)
  63.     id AA15057; Wed, 27 Apr 94 14:25:32 EST
  64. Message-Id: <9404270425.AA15057@atlas>
  65. From: paul@atlas.abccomp.oz.au
  66. Date: Wed, 27 Apr 1994 14:25:31 -0500
  67. X-Mailer: Mail User's Shell (7.2.2 4/12/91)
  68. To: mmthomas@hpccoa.corp.hp.com,
  69.         Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
  70. Subject: Re: Unix to Winsock select()
  71.  
  72. Thus expounded Markham Thomas on Apr 26, 6:22pm:
  73. /--------------------
  74. |     I have a problem with porting sockets code from an HP
  75. | 3000 and 9000 to the Winsock platform.  In particular the problem
  76. | occurs on the select() statement.
  77. |    The unix man pages for HP show the following as the definition
  78. | for the second parameter to select:   (readfs is the variable)
  79. |
  80. |   (option1)         struct fd_set readmask, readfds;
  81. |
  82. |   (option2)         int readmask = 0;
  83. |             int readfs;
  84. |
  85. |    The HP systems will take either an int or a fd_set structure pointer as the
  86. |parameter.  You would use the structure if the integer bit mask can't 
  87. |hold the number of sockets you want to test.
  88. |    The problem is that I wanted to have the same code (or prevent a major
  89. |    rewrite) as that on the HP systems.  It appears that the winsock.h header
  90. |    file desires the structure pointer at the parm, and won't support an int.
  91.  
  92. That's correct - the Winsock select() function only operates on an
  93. fd_set structure, because for Winsock an fd_set is implemented differently
  94. than in unix.
  95.  
  96.     In Winsock, an 'fd_set' is an array of sockets, with each
  97. one holding a possible socket handle, wheras in Unix the fd_set is a
  98. collection of integers constructing a bitmask, with each bit associated with
  99. a socket. This change had to be made because in Windows Sockets, the 
  100. value of a 'socket' handle could be any possible value (except 0xFFFF),
  101. while under unix a 'socket handle' is a small integer (4,5,6 etc).
  102.  
  103. The FD_SET, FD_CLR macros are also re-written so that, as long as your
  104. code uese these, the different underlying structure of the fd_set is
  105. transparent to the application.
  106.  
  107. I still can't see your problem - code for the fd_set case at all times,
  108. and ignore the fact that HP unix will, in some cases, allow you to use
  109. an integer instead of an fd_set.
  110.  
  111.  
  112. -- 
  113. Paul Brooks              |paul@abccomp.oz.au       |Emerging Standard:
  114. TurboSoft Pty Ltd        |pwb@newt.phys.unsw.edu.au|  one that has not yet
  115. 579 Harris St., Ultimo   |                         |  been superseded.
  116. Sydney Australia 2007    |ph: +61 2 281 3155       |  
  117. From paul@atlas.dev.abccomp.oz.au Wed Apr 27 09:53:14 1994
  118. Received: from usage.csd.unsw.OZ.AU by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
  119.           id AA23736; Wed, 27 Apr 1994 00:40:45 -0400
  120. Received: by usage.csd.unsw.OZ.AU id AA13120
  121.   (5.65c/IDA-1.4.4 for winsock-hackers%sunsite.unc.edu); Wed, 27 Apr 1994 14:39:47 +1000
  122. Received: by atlas (4.1/1.35)
  123.     id AA15173; Wed, 27 Apr 94 14:53:15 EST
  124. Message-Id: <9404270453.AA15173@atlas>
  125. From: paul@atlas.abccomp.oz.au
  126. Date: Wed, 27 Apr 1994 14:53:14 -0500
  127. X-Mailer: Mail User's Shell (7.2.2 4/12/91)
  128. To: FisherM@is3.indy.tce.com,
  129.         Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
  130. Subject: RE: DNS interface
  131.  
  132. Thus expounded Fisher Mark on Apr 26, 6:46pm:
  133. /--------------------
  134. |
  135. |To quote paul@atlas.abccomp.oz.au (">") and pbh@MIT.EDU ("|>"):
  136. |>|Most vendors already have res_mkquery() or the equivalent in their stacks
  137. |>|because it is used by the DNS support. Why don't we just make sure this 
  138. |API
  139. |>|is exposed in the next release of the spec?
  140. |>
  141. |>Oh dear. Our internals don't use anything resembling res_mkquery() - can we
  142. |>take a straw-poll - which stacks _do_ have a res_mkquery(), whether
  143. |>accessable from outside the DLL or not, and which stacks don't?
  144. |
  145. |Furthermore (to betray my ignorance :)) is the DNS interface defined in an 
  146. |RFC, or do you have to look at example code to figure it out?  I have the 
  147. |example code -- I'm just curious...
  148.  
  149. There is no RFC that standardises the API for DNS, just as there is no
  150. RFC standardising an API for TCP/IP in general (these is no 'BSD sockets"
  151. RFC) - most people have copied the interface adopted by Unix popularised
  152. by BSD, known as "BSD Sockets", although many are moving to
  153. an alternative API called "TLI" - Transport Level Interface. The same,
  154. I guess, for the interface to DNS (which was added much later than the
  155. original 'BSD sockets' interface was codified), which for BSD was added
  156. because the original name resolution routines (gethostbyname etc) were
  157. designed for reading database files, not for dynamic server queries, and 
  158. couldn't handle more generic DNS-specific queries like 'which server
  159. handles domain YYY' and 'who is in charge of the DNS for domain XXX'.
  160.  
  161. |I do like the idea of a standard DLL for this.
  162.  
  163. So do I - much more than forcing each vendor to implement a rarely
  164. used function like res_mkquery(), which is very DNS-specific. Not every
  165. stack, and I would guess in fact that very few stacks, actually implement
  166. their gethostbyYYY() calls as generic calls as an internal call to
  167. a 'res_mkquery' routine - certainly we manage quite well without one.
  168.  
  169. The correct solution for a more generic DNS interface would be a DLL (that
  170. may well implement 'res_mkquery()') that creates the appropriate UDP
  171. datagrams and sockets, and does the query utilising the base SOCK_DGRAM
  172. capability of the generic Windows Sockets stack underneath. Then the
  173. single DLL could be used by everybody on top of everybody's stack, and
  174. only one person needs to invent the wheel.
  175.  
  176. Cheers,
  177.  
  178. -- 
  179. Paul Brooks              |paul@abccomp.oz.au       |Emerging Standard:
  180. TurboSoft Pty Ltd        |pwb@newt.phys.unsw.edu.au|  one that has not yet
  181. 579 Harris St., Ultimo   |                         |  been superseded.
  182. Sydney Australia 2007    |ph: +61 2 281 3155       |  
  183. From paul@atlas.dev.abccomp.oz.au Wed Apr 27 09:57:06 1994
  184. Received: from usage.csd.unsw.OZ.AU by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
  185.           id AA24186; Wed, 27 Apr 1994 00:43:33 -0400
  186. Received: by usage.csd.unsw.OZ.AU id AA13244
  187.   (5.65c/IDA-1.4.4 for winsock-hackers%sunsite.unc.edu); Wed, 27 Apr 1994 14:43:40 +1000
  188. Received: by atlas (4.1/1.35)
  189.     id AA15202; Wed, 27 Apr 94 14:57:07 EST
  190. Message-Id: <9404270457.AA15202@atlas>
  191. From: paul@atlas.abccomp.oz.au
  192. Date: Wed, 27 Apr 1994 14:57:06 -0500
  193. X-Mailer: Mail User's Shell (7.2.2 4/12/91)
  194. To: paul@atlas.abccomp.oz.au,
  195.         Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
  196. Subject: Re: FW: What's happening here?
  197.  
  198. Thus expounded paul@atlas on Apr 26, 6:32pm:
  199. /--------------------
  200. |
  201. |Assuming port 1111 is the server port, and 1026 is your Winsock's port,
  202. |this looks like a TCP bug. In the second line (the first 1026->1111 packet)
  203. |the ACK field should be set to the previous SEQ field+1. Because its not,
  204. |the remote machine is aborting the connection and returning a RST.
  205.  
  206. etc.
  207.  
  208. Anyone know which 'white hole' this message came from? I dimly
  209. remember sending this many months ago, and don't remember if it was
  210. seen on the list back then, but it certainly aint recent!
  211. Wierd.
  212.  
  213.  
  214. -- 
  215. Paul Brooks              |paul@abccomp.oz.au       |Emerging Standard:
  216. TurboSoft Pty Ltd        |pwb@newt.phys.unsw.edu.au|  one that has not yet
  217. 579 Harris St., Ultimo   |                         |  been superseded.
  218. Sydney Australia 2007    |ph: +61 2 281 3155       |  
  219. From meunier@capsogeti.fr Wed Apr 27 10:50:03 1994
  220. Received: from Relay1.OLEANE.NET by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
  221.           id AA07478; Wed, 27 Apr 1994 02:51:58 -0400
  222. Received: from csinn (csinn.cgs.fr [194.2.88.135]) by relay1.oleane.net (8.6.5/8.6.5) with SMTP id IAA22451 for <winsock-hackers@sunsite.unc.edu>; Wed, 27 Apr 1994 08:51:54 +0200
  223. X-Authentication-Warning: relay1.oleane.net: Host csinn.cgs.fr claimed to be csinn
  224. Received: from hercule by csinn (4.1/CSI2.2)
  225.     id AA00307; Wed, 27 Apr 94 08:51:13 +0200
  226. From: Jean-Luc Meunier <meunier@capsogeti.fr>
  227. Received: by hercule (AIX 3.2/UCB 5.64/CSI2.2)
  228.     id AA17751; Wed, 27 Apr 1994 08:50:03 +0200
  229. Date: Wed, 27 Apr 1994 08:50:03 +0200
  230. Message-Id: <9404270650.AA17751@hercule>
  231. To: winsock-hackers@sunsite.unc.edu
  232. Subject: unsubscribe
  233.